home *** CD-ROM | disk | FTP | other *** search
- Path: s02.pavilion.co.uk!usenet
- From: AJRobb@pavilion.co.uk (Andy J Robb)
- Newsgroups: comp.lang.c
- Subject: Re: Binary Tree and MSC/C++7.00
- Date: Mon, 08 Jan 1996 21:33:13 GMT
- Organization: Pavilion Internet plc
- Message-ID: <4cs2gc$6gf@s02.pavilion.co.uk>
- References: <HAKOLA.96Jan7002825@lk-hp-16.hut.fi>
- NNTP-Posting-Host: poolb17.pavilion.co.uk
- X-Newsreader: Forte Free Agent 1.0.82
-
- hakola@snakemail.hut.fi (Petri Hakola) wrote:
-
-
- > It seems to me that I suffer some kind of partial amnesia. I
- > can build a binary tree, add stuff to it, but how do I destroy
- > it. I've tried nearly everyting, but there's either General
- > Protection Error or some remains of prior members. I have
- > quite embarassing feeling that I have forget something so
- > obvious that it should almost 'hit the eye', but...
-
- > if(root == NULL)
- > return;
- > delete_tree(root->left);
- > free(root);
- > delete_tree(root->right);
-
- > Is this correct or ?
-
-
- root->left->right = root->right;
- root->right->left = root->left;
- free(root);
- -----BEGIN PGP PUBLIC KEY BLOCK-----
- Version: 2.6.2i
-
- mQCNAy/MpRwAAAEEAOt6uBYqT8yv9EmqNhK8m6v+bYi8QjnGW3Bo6iU1gsMj5pa6
- MHgq99c8deADbE3cbJ6uZS9v5pZE3WCf6HCQjlB5iULA5RZzMdAumd/WUzuL9UT3
- B44D9EqqFIL79FlYb56v4oKFqFp1/J2bIpYUwnUvabGzGjdLrpPl4P16x9sNAAUR
- tCNBbmR5IEogUm9iYiA8QUpSb2JiQHBhdmlsaW9uLmNvLnVrPrQhQW5keSBSb2Ji
- IDxBSlJvYmJAcGF2aWxpb24uY28udWs+
- =/wVD
- -----END PGP PUBLIC KEY BLOCK-----
-
-